Skip to content

Make goto_{model,functions}t::unload return a value #7678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2023

Conversation

tautschnig
Copy link
Collaborator

This will enable its use in place of .erase(...) when such a call required the number of functions that had been removed. The key user will be a refactored initialize-function re-creation code.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

This will enable its use in place of .erase(...) when such a call
required the number of functions that had been removed. The key user
will be a refactored initialize-function re-creation code.
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Patch coverage: 62.50% and no project coverage change.

Comparison is base (f39a5c1) 78.52% compared to head (1bc815f) 78.52%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7678   +/-   ##
========================================
  Coverage    78.52%   78.52%           
========================================
  Files         1674     1674           
  Lines       191971   191973    +2     
========================================
+ Hits        150738   150740    +2     
  Misses       41233    41233           
Impacted Files Coverage Δ
jbmc/src/java_bytecode/lazy_goto_functions_map.h 94.87% <0.00%> (ø)
jbmc/src/java_bytecode/lazy_goto_model.cpp 88.65% <0.00%> (ø)
src/goto-programs/goto_functions.h 100.00% <100.00%> (ø)
src/goto-programs/goto_model.h 81.63% <100.00%> (+0.38%) ⬆️
src/goto-programs/initialize_goto_model.cpp 89.13% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

/// Remove the function named \p name from the function map, if it exists.
/// \return Returns 0 when \p name was not present, and 1 when \p name was
/// removed.
std::size_t unload(const key_type &name) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is using std::size_t for this purpose a thing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you recommend using underlying_mapt::size_type instead? That's the exact return type of erase, but I'd expect it to be std::size_t on all platforms.

@peterschrammel peterschrammel removed their assignment May 5, 2023
@tautschnig tautschnig merged commit 6d35ec0 into diffblue:develop May 5, 2023
@tautschnig tautschnig deleted the features/unload branch May 5, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants